/*
 * Creation : 27/09/2013
 */
/**
 * 
 */
package com.japcatalog.service.impl;

import java.util.Collection;

import com.japcatalog.dao.ModelDao;
import com.japcatalog.dao.impl.ModelDaoImpl;
import com.japcatalog.model.Model;
import com.japcatalog.service.ModelService;

/**
 * The Class ModelServiceImpl.
 * 
 * @author Fernando Ariel Perelli
 */
public class ModelServiceImpl implements ModelService {

	/** The model dao. */
	private ModelDao modelDao = new ModelDaoImpl();

	/**
	 * Sets the model dao.
	 * 
	 * @param modelDao
	 *            the new model dao
	 */
	public void setModelDao(ModelDao modelDao) {
		this.modelDao = modelDao;
	}

	/**
	 * Gets the model dao.
	 * 
	 * @return the model dao
	 */
	public ModelDao getModelDao() {
		return modelDao;
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see com.japcatalog.service.ModelService#findById(java.lang.Long)
	 */
	@Override
	public Model findById(Long id) {
		return this.modelDao.findById(id);
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see com.japcatalog.service.ModelService#findALL()
	 */
	@Override
	public Collection<Model> findALL() {
		return this.modelDao.findAll();
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see com.japcatalog.service.ModelService#create(com.japcatalog.model.Model)
	 */
	@Override
	public Long create(Model model) {
		return this.modelDao.create(model);
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see com.japcatalog.service.ModelService#update(com.japcatalog.model.Model)
	 */
	@Override
	public void update(Model model) {
		this.modelDao.update(model);
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see com.japcatalog.service.ModelService#delete(com.japcatalog.model.Model)
	 */
	@Override
	public void delete(Model model) {
		this.modelDao.delete(model);
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see com.japcatalog.service.ModelService#delete(java.lang.Long)
	 */
	@Override
	public void delete(Long id) {
		this.modelDao.delete(id);

	}

}
